/**
*
* @file tlv.h
*
* @brief TLV creation/parsing utility function declarations
*
* Copyright ?2011 HID Corporation.  All rights reserved.
*
* This software is protected by copyright law and international treaties.
* Any unauthorized reproduction, distribution or use of the software is prohibited.
*
*/

#ifndef _tlv_h
#define _tlv_h
#include <stdint.h>

#define TLV_ANY_TAG             ((uint16_t)0xFFFF)
#define TLV_ANY_LENGTH_SIZE     ((uint8_t)0xFF)

extern uint16_t tlv_readTag(uint8_t** Data, uint16_t* length);
extern uint16_t tlv_readLength(uint8_t** Data, uint16_t* length);
extern uint16_t tlv_search(uint8_t** Data, uint16_t* length, uint16_t searchTag);

extern void tlv_skip(uint16_t skipLength, uint8_t** result, uint16_t* resultLength);
extern void tlv_setTag(uint8_t tag, uint8_t** result, uint16_t* resultLength);
extern void tlv_setData(uint8_t* Data, uint16_t dataLength, uint8_t** result, uint16_t* resultLength);
extern void tlv_setLength(uint16_t length, uint8_t** result, uint16_t* resultLength, uint8_t forcedLengthSize);
extern void tlv_create(uint8_t tag, uint8_t* Data, uint16_t dataLength, uint8_t** result, uint16_t* resultLength);

#endif


